﻿using System;
using System.Collections.Generic;
using System.Text;
using ViewModels;

namespace LogForParameter.IServices
{
    public static class Public
    {
        /// <summary>
        /// 返回成功的output
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static OutPut NewOP_Ok(string msg)
        {
            OutPut op = new OutPut
            {
                Msg = msg,
                ResultStatus = "200",
                ResultData = new List<object>()
            };
            return op;
        }

        /// <summary>
        /// 返回未查到数据的output
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static OutPut NewOP_Unfind(string msg)
        {
            OutPut op = new OutPut
            {
                Msg = msg,
                ResultStatus = "301",
                ResultData = new List<object>(),
            };
            return op;
        }

        /// <summary>
        /// 返回失败的output
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static OutPut NewOP_Error(string msg)
        {
            OutPut op = new OutPut
            {
                Msg = msg,
                ResultStatus = "401",
                ResultData = new List<object>(),
            };
            return op;
        }
    }
}
